{% extends "blog/base.html" %}
{% load blog_tags %}
 
{% block title %}我的{% endblock %}
 
{% block content %}
    <h4>所有发布</h4>
    {% if tag %}
        <h4>{{ tag.name }}标签</h4>
    {% endif %}
    {% for post in posts %}
        <h2>
            <a href="{{ post.get_absolute_url }}">{{ post.title }}</a>
        </h2>
        <p class="tags">
            标签:
            {% for tag in post.tags.all %}
                <a href="{% url "blog:post_list_by_tag" tag.slug %}">{{ tag.name }}</a>
                {% if not forloop.last %}, {% endif %}
            {% endfor %}
        </p>
        {{ post.body|markdown|truncatewords_html:30 }}
        <p class="date">
            作者：{{ post.author }}  发布时间：{{ post.publish }}
        </p>
    {% endfor %}
    {% include "pagination.html" with page=posts %}
{% endblock %}